package com.mbc.mapper;


import com.mbc.vo.PopularScienceTweetInfoVO;
import com.mbc.vo.PopularScienceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.ArrayList;

/**
 * <p>
 * 科普表 Mapper 接口
 * </p>
 *
 * @author suimeng
 * @since 2024-04-16
 */
@Mapper
public interface PopularScienceMapper {

    @Select("select title,image,number_views from mbc_popular_science order by release_date desc ")
    ArrayList<PopularScienceVO> getPopularScienceTweets(LocalDateTime now);

    @Select("select user_id, title, content, image, number_views, release_date from mbc_popular_science where title = #{title}")
    PopularScienceTweetInfoVO getPopularScienceTweetInfo(String title);
}
